/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.cx1.model.utils;

import org.apache.commons.lang.StringUtils;
import org.cx1.model.UserType;

/**
 *
 * @author CX
 */
public class KUserTypes {
        
    public static final UserType DEFAULT = new UserType(KUserTypeIDs.DEFAULT, "Default", null, null);
    public static final UserType ADMIN = new UserType(KUserTypeIDs.ADMIN, "Default", null, null);
    
    public static final UserType TENANT = new UserType(KUserTypeIDs.TENANT, "Default", null, null);
    public static final UserType LANDLORD = new UserType(KUserTypeIDs.LANDLORD, "Default", null, null);
    public static final UserType BROKER = new UserType(KUserTypeIDs.BROKER, "Default", null, null);
    public static final UserType AGENT = new UserType(KUserTypeIDs.AGENT, "Default", null, null);
    
    //CX: TODO: temporary service
    public static UserType getUserType(String id) {
        UserType userType = null;
        if (StringUtils.equals(id, KUserTypeIDs.DEFAULT)) {
            userType = DEFAULT;
        }
        else if (StringUtils.equals(id, KUserTypeIDs.ADMIN)) {
            userType = ADMIN;
        }
        
        else if (StringUtils.equals(id, KUserTypeIDs.TENANT)) {
            userType = TENANT;
        }
        else if (StringUtils.equals(id, KUserTypeIDs.LANDLORD)) {
            userType = LANDLORD;
        }
        else if (StringUtils.equals(id, KUserTypeIDs.BROKER)) {
            userType = BROKER;
        }
        else if (StringUtils.equals(id, KUserTypeIDs.AGENT)) {
            userType = AGENT;
        }
        return userType;
    }
}
